<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Jing support for XML Schema Datatypes</title>
</head>
<body>
<h1>Jing support for XML Schema Datatypes</h1>

<p>Jing contains a built-in implementation of the W3C <a
href="http://www.w3.org/TR/xmlschema-2/">XML Schema Part 2</a>
Recommendation. Jing follows the <a
href="http://www.oasis-open.org/committees/relax-ng/xsd.html">Guidelines
for using W3C XML Schema Datatypes with RELAX NG</a>.</p>

<p>The implementation of the <code>pattern</code> facet (and of some
of the more complicated datatypes) requires an implementation of
regular expressions as defined in <a
href="http://www.w3.org/TR/xmlschema-2/#regexs">XML Schema Part 2</a>.
Jing provides implementations based on:</p>

<ul>

<li>the <a href="http://java.sun.com/j2se/1.4/download.html">J2SE
1.4</a> <code>java.util.regex</code> package</li>

<li><a href="http://xml.apache.org/xerces2-j/index.html">Xerces Java
2</a></li>

<li><a href="http://xml.apache.org/xerces-j/index.html">Xerces Java
1</a> (version 1.3.1 or later)</li>

</ul>

<p>Jing will automatically use the first of the above implementations
for which the necessary classes are available on your CLASSPATH.</p>

<p>You can interface a different implementation of XML Schema regular
expressions by implementing the interface
<code>com.thaiopensource.datatype.xsd.RegexEngine</code>.  Jing finds
an implementation of this interface using the service provider
technique: a JAR file containing an implementation of this interface
must contain a file
<code>META-INF/services/com.thaiopensource.datatype.xsd.RegexEngine</code>
that contains the name of class that implements the interface.  Jing
will automatically find and use the implementation if the JAR file is
added to the CLASSPATH.</p>

<p>For example, you can use IBM's Regex for Java package, available
from <a href="http://www.alphaworks.ibm.com">Alphaworks</a>. You can
create a <code>RegexEngine</code> that uses this simply by changing
<code>org.apache.xerces.utils</code> to <code>com.ibm</code> in
<code>com/thaiopensource/datatype/xsd/regex/xerces/RegexEngineImpl.java</code>.
The sample implementation does not include such a class because the
license for Regex for Java is currently rather restrictive.</p>

</body>
</html>
